package java_basics;


import java.util.Scanner;

/**
 * @author 孤雪唯方
 * @date 2024/07/15
 * @description 类型转换
 */
public class TypeConversion {

    public static void typeConversion() {
        Scanner scanner = new Scanner(System.in);
        System.out.print("请输入一个double型数值：");
        double num = scanner.nextDouble();
        System.out.println("double型数值：" + num);
        int intNum = (int) num;
        System.out.println("int型数值：" + intNum);
    }


    public static void main(String[] args) {
        typeConversion();
    }


}
